package com.ny.demo5162;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        Emp emp1 = new Emp();
        emp1.setNumber("1001");
        emp1.setName("A");
        emp1.setAge(18);

        Emp emp2 = new Emp();
        emp2.setNumber("1002");
        emp2.setName("B");
        emp2.setAge(18);

        Emp emp3 =new Emp("1003","C",18);
        System.out.println(emp3.getNumber());
        System.out.println(emp3.getName());
        System.out.println(emp3.getAge());

        List  list = new ArrayList();
        list.add(emp1);
        list.add(emp2);
        list.add(emp3);

        System.out.println("集合的元素");
        for(int i = 0;i<list.size();i++){
            System.out.println(list.get(i));
        }
    }

}
